/**
 * 
 */
package cn.tonyqiu.wonuly.model;

import java.util.Date;

/**
 * @author <a href="mailto:tony.qiu.smart@gmail.com">Tony Qiu</a>
 * 
 */
public class Account extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2290594975290133387L;
	private Integer id;
	private Integer userId;
	private String name;
	private String bankId;
	private String bankAccount;
	private float initialBalance;
	private Date createTime;

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the userId
	 */
	public Integer getUserId() {
		return userId;
	}

	/**
	 * @param userId
	 *            the userId to set
	 */
	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the bankId
	 */
	public String getBankId() {
		return bankId;
	}

	/**
	 * @param bankId
	 *            the bankId to set
	 */
	public void setBankId(String bankId) {
		this.bankId = bankId;
	}

	/**
	 * @return the bankAccount
	 */
	public String getBankAccount() {
		return bankAccount;
	}

	/**
	 * @param bankAccount
	 *            the bankAccount to set
	 */
	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	/**
	 * @return the initialBalance
	 */
	public float getInitialBalance() {
		return initialBalance;
	}

	/**
	 * @param initialBalance
	 *            the initialBalance to set
	 */
	public void setInitialBalance(float initialBalance) {
		this.initialBalance = initialBalance;
	}

	/**
	 * @return the createDate
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @param createDate
	 *            the createDate to set
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.model.BaseObject#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Account)) {
			return false;
		}
		final Account account = (Account) o;
		if (account.getId() != null
				&& account.getId().intValue() == id.intValue()) {
			return true;
		}
		return false;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.model.BaseObject#hashCode()
	 */
	@Override
	public int hashCode() {
		return id != null ? id.intValue() : 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.model.BaseObject#toString()
	 */
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("id=" + id).append(":name=" + name).append(
				":bankId=" + bankId).append(":bankAccount=" + bankAccount)
				.append(":initialBalance=" + initialBalance).append(
						":createDate=" + createTime);
		return sb.toString();
	}

}
